package com.prs.crm.domain.purchase;

import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.OrderBy;
import javax.persistence.Table;
import org.hibernate.annotations.Cascade;
import com.prs.crm.domain.BaseEntity;

@Entity
@Table(name = "purchase_paymentgather")
public class PaymentGather extends BaseEntity {

	private static final long serialVersionUID = -4867503240956693033L;
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private Integer id;

	@OneToOne
	private PaymentOrder paymentOrder;

	@OneToMany(mappedBy = "paymentGather")
	@OrderBy
	@Cascade( { org.hibernate.annotations.CascadeType.ALL,
			org.hibernate.annotations.CascadeType.DELETE_ORPHAN })
	private Set<PaymentDetails> details;

	/**
	 *采购额
	 */
	private Double purchaseMony;

	/**
	 *计划付款额
	 */

	private Double payPlanMony;
	/**
	 *实际付款额
	 */

	private Double payRealityMony;
	/**
	 *开票额
	 */
	private Double billMony;

	/**
	 *付款状态
	 */
	@Column(columnDefinition = "Integer(11) default '0'")
	private int payState;

	/**
	 *开票状态
	 */
	@Column(columnDefinition = "Integer(11) default '0'")
	private int billState;
	
	/**
	 * 实际付款状态
	 * @return
	 */
	
	@Column(columnDefinition = "Integer(11) default '0'")
	private int arelityState;

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public Double getPurchaseMony() {
		return purchaseMony;
	}

	public void setPurchaseMony(Double purchaseMony) {
		this.purchaseMony = purchaseMony;
	}

	public Double getPayPlanMony() {
		return payPlanMony;
	}

	public void setPayPlanMony(Double payPlanMony) {
		this.payPlanMony = payPlanMony;
	}

	public Double getPayRealityMony() {
		return payRealityMony;
	}

	public void setPayRealityMony(Double payRealityMony) {
		this.payRealityMony = payRealityMony;
	}

	public Double getBillMony() {
		return billMony;
	}

	public void setBillMony(Double billMony) {
		this.billMony = billMony;
	}

	public int getPayState() {
		return payState;
	}

	public void setPayState(int payState) {
		this.payState = payState;
	}

	public int getBillState() {
		return billState;
	}

	public void setBillState(int billState) {
		this.billState = billState;
	}

	public Set<PaymentDetails> getDetails() {
		return details;
	}

	public void setDetails(Set<PaymentDetails> details) {
		this.details = details;
	}

	public PaymentOrder getPaymentOrder() {
		return paymentOrder;
	}

	public void setPaymentOrder(PaymentOrder paymentOrder) {
		this.paymentOrder = paymentOrder;
	}

	public int getArelityState() {
		return arelityState;
	}

	public void setArelityState(int arelityState) {
		this.arelityState = arelityState;
	}

}
